package cn.jy.finanlle.controller;


import cn.jy.common.domain.financea.ExpressPaymentRecords;
import cn.jy.common.domain.vo.ExpressPaymentRecordsVo;
import cn.jy.finanlle.mapper.ExpressPaymentRecordsMapper;
import cn.jy.finanlle.service.ExpressPaymentRecordsService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/payment")
@CrossOrigin
public class ExpressPaymentRecordsController {
    @Autowired
    private ExpressPaymentRecordsService expressPaymentRecordsService;
    @Autowired
    private ExpressPaymentRecordsMapper expressPaymentRecordsMapper;

    @GetMapping("/list")
    public PageInfo<ExpressPaymentRecordsVo> selectExpressPaymentRecordsList(ExpressPaymentRecordsVo expressPaymentRecordsVo){
        return expressPaymentRecordsService.selectExpressPaymentRecordsList(expressPaymentRecordsVo);
    }

    @GetMapping("/findExpressPaymentRecordsByPhone")
    public ExpressPaymentRecords findExpressPaymentRecordsByPhone(@RequestParam("phone") String phone){
        return expressPaymentRecordsService.findExpressPaymentRecordsByPhone(phone);
    }

    @GetMapping("/findExpressPaymentRecordsById")
    public ExpressPaymentRecords findExpressPaymentRecordsById(@RequestParam("id") Integer id){
        return expressPaymentRecordsMapper.findExpressPaymentRecordsById(id);
    }
}
